<template>
  <el-form ref="form" :model="form" label-width="80px">
    <el-form-item label="民族">
      <el-select v-model="form.nationality" placeholder="请选择活动区域">
        <el-option label="汉族" value="汉族"></el-option>
        <el-option label="壮族" value="壮族"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="籍贯">
      <el-input v-model="form.nativePlace" oninput="value=value.replace(/[\d]/g,'')"></el-input>
    </el-form-item>
    <el-form-item label="政治面貌">
      <el-select v-model="form.politicsStatus" placeholder="请选择活动区域">
        <el-option label="群众" value="群众"></el-option>
        <el-option label="团员" value="团员"></el-option>
        <el-option label="党员" value="党员"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="联系电话">
      <el-input v-model="form.phoneNumber" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
    export default {
        name: "editorPersonalInformation",
      data() {
        return {
          form: {
            nationality: '',
            nativePlace: '',
            politicsStatus: '',
            phoneNumber: ''
          }
        }
      },
      methods: {
        submit(){
          if (this.form.nationality || this.form.nativePlace || this.form.politicsStatus || this.form.phoneNumber) {
            this.$qs.stringify(this.form);
            console.log(this.$qs.stringify(this.form));
            var url = this.HOME + '';
            this.$axios.post(url,this.$qs.stringify(this.form)).then((response) => {
              this.datalist = response.data;
              // console.log(this.datalist);
              sessionStorage.setItem('state',this.datalist.state);
              sessionStorage.setItem('state',this.datalist.state);
              if (this.datalist.state === "success") {
                alert("登陆成功");
                this.$router.push({ path:'/homePage'});
              }else {
                alert(this.datalist.msg);
                return;
              }
            })
          }
        }
      }
    }
</script>

<style scoped>
  .el-input{
    width: 216px;
  }

  .el-form-item{
    padding: 50px;
  }
</style>
